package com.myfb.antstorm.eurek.client.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2018/4/12.
 */
@RestController
public class HelloWorldController {
    @Autowired
    DiscoveryClient discoveryClient;

    @Value("${server.port}")
    private Integer port;

    @GetMapping("/hello")
    public String hello() {
        String services = "Services: " + discoveryClient.getServices() +" port: "+port;
        System.out.println(services);
        return services;
    }
}
